package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-01-29
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_base_bank_bin")
@ApiModel(value = "BaseBankBin", description = "")
@AllArgsConstructor
public class BaseBankBin extends Entity<String> {

    private static final long serialVersionUID = 1L;

    /**
     * 卡BIN
     */
    @ApiModelProperty(value = "卡BIN")
    @NotEmpty(message = "卡BIN不能为空")
    @Length(max = 32, message = "卡BIN长度不能超过32")
    @TableField(value = "bank_bin", condition = LIKE)
    @Excel(name = "卡BIN")
    private String bankBin;

    /**
     * 长度
     */
    @ApiModelProperty(value = "长度")
    @NotNull(message = "长度不能为空")
    @TableField("length")
    @Excel(name = "长度")
    private Integer length;

    /**
     * 卡号长度
     */
    @ApiModelProperty(value = "卡号长度")
    @NotNull(message = "卡号长度不能为空")
    @TableField("card_length")
    @Excel(name = "卡号长度")
    private Integer cardLength;

    /**
     * 卡类型
     */
    @ApiModelProperty(value = "卡类型")
    @NotEmpty(message = "卡类型不能为空")
    @Length(max = 2, message = "卡类型长度不能超过2")
    @TableField(value = "card_type", condition = LIKE)
    @Excel(name = "卡类型")
    private String cardType;

    /**
     * 卡号模板
     */
    @ApiModelProperty(value = "卡号模板")
    @NotEmpty(message = "卡号模板不能为空")
    @Length(max = 32, message = "卡号模板长度不能超过32")
    @TableField(value = "card_id", condition = LIKE)
    @Excel(name = "卡号模板")
    private String cardId;

    /**
     * 卡BIN类型
     */
    @ApiModelProperty(value = "卡BIN类型")
    @NotEmpty(message = "卡BIN类型不能为空")
    @Length(max = 2, message = "卡BIN类型长度不能超过2")
    @TableField(value = "bank_bin_type", condition = LIKE)
    @Excel(name = "卡BIN类型")
    private String bankBinType;

    /**
     * 银行简称
     */
    @ApiModelProperty(value = "银行简称")
    @NotEmpty(message = "银行简称不能为空")
    @Length(max = 32, message = "银行简称长度不能超过32")
    @TableField(value = "bank_abbr", condition = LIKE)
    @Excel(name = "银行简称")
    private String bankAbbr;

    /**
     * 银行名称
     */
    @ApiModelProperty(value = "银行名称")
    @Length(max = 32, message = "银行名称长度不能超过32")
    @TableField(value = "bank_name", condition = LIKE)
    @Excel(name = "银行名称")
    private String bankName;

    /**
     * 银行代码
     */
    @ApiModelProperty(value = "银行代码")
    @Length(max = 32, message = "银行代码长度不能超过32")
    @TableField(value = "bank_code", condition = LIKE)
    @Excel(name = "银行代码")
    private String bankCode;


    @Builder
    public BaseBankBin(String id, String createUser, LocalDateTime createTime, String updateUser, LocalDateTime updateTime, 
                    String bankBin, Integer length, Integer cardLength, String cardType, String cardId, 
                    String bankBinType, String bankAbbr, String bankName, String bankCode) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.bankBin = bankBin;
        this.length = length;
        this.cardLength = cardLength;
        this.cardType = cardType;
        this.cardId = cardId;
        this.bankBinType = bankBinType;
        this.bankAbbr = bankAbbr;
        this.bankName = bankName;
        this.bankCode = bankCode;
    }

}
